// 注册暂时还不需要用到store存储状态
import { DOREGISTERVALUE } from "../constants";

const initState = {
    register: {
        register_success: false,
        captcha_error: false,
        email_error: false,
        username: ''
    }
}

export default function RegisterReducer(preState = initState, action) {
    const {type, data} = action
    switch (type) {
        case DOREGISTERVALUE:
            return {
                ...preState,
                register:Object.assign({}, preState.register,data)
            }
        default:
            // return {...prepState} // 会导致数据持久化失效
            var state = preState
            return state
    }
}